﻿CREATE PROCEDURE [dbo].[spRebuildAllSearchKeys]
AS
	set nocount on
	declare cRebuild cursor local for
	select CustomerID from tblCustomer

	declare @CustomerID int
	
	open cRebuild
	fetch next from cRebuild into @CustomerID
	while @@FETCH_STATUS = 0
	begin
		exec spBuildSearchKeys @CustomerID
		
		fetch next from cRebuild into @CustomerID
	end
	close cRebuild
	deallocate cRebuild

RETURN 0